package io.jpress.service.provider;

import io.jboot.aop.annotation.Bean;
import io.jboot.db.model.Columns;
import io.jpress.commons.service.JPressServiceBase;
import io.jpress.model.UserPasswdRecord;
import io.jpress.service.UserPasswdRecordService;

@Bean
public class UserPasswdRecordServiceProvider extends JPressServiceBase<UserPasswdRecord> implements UserPasswdRecordService {

    @Override
    public UserPasswdRecord findLastByUserId(Long userId) {
        return findFirstByColumns(Columns.create("user_id",userId)
                .eq("update_status",UserPasswdRecord.STATUS_SUCCESS),"id desc");
    }
}